﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace igflow
{
    class igFont
    {
        public Texture2D texture;
        public struct character
        {
            public int x; // top left pixel
            public int y;
            public int width; // charWidth
            public int height; // charHeight
            public character(int x, int y, int w, int h)
            {
                this.x = x;
                this.y = y;
                this.width = w;
                this.height = h;
            }
        }

        public Dictionary<char,character> Characters = new Dictionary<char,character>();
        public igFont()
        {
            texture = World.contentManager.Load<Texture2D>("font");

            Characters.Add('A', new character(0, 0, 32, 32));
            Characters.Add('B', new character(32, 0, 32, 32));
            Characters.Add('C', new character(64, 0, 32, 32));
            Characters.Add('D', new character(96, 0, 32, 32));
            Characters.Add('E', new character(128, 0, 32, 32));
            Characters.Add('F', new character(160, 0, 32, 32));
            Characters.Add('G', new character(192, 0, 32, 32));
            Characters.Add('H', new character(224, 0, 32, 32));

            Characters.Add('I', new character(0, 32, 32, 32));
            Characters.Add('J', new character(32, 32, 32, 32));
            Characters.Add('K', new character(64, 32, 32, 32));
            Characters.Add('L', new character(96, 32, 32, 32));
            Characters.Add('M', new character(128, 32, 32, 32));
            Characters.Add('N', new character(160, 32, 32, 32));
            Characters.Add('O', new character(192, 32, 32, 32));
            Characters.Add('P', new character(224, 32, 32, 32));

            Characters.Add('Q', new character(0, 64, 32, 32));
            Characters.Add('R', new character(32, 64, 32, 32));
            Characters.Add('S', new character(64, 64, 32, 32));
            Characters.Add('T', new character(96, 64, 32, 32));
            Characters.Add('U', new character(128, 64, 32, 32));
            Characters.Add('V', new character(160, 64, 32, 32));
            Characters.Add('W', new character(192, 64, 32, 32));
            Characters.Add('X', new character(224, 64, 32, 32));

            Characters.Add('Y', new character(0, 96, 32, 32));
            Characters.Add('Z', new character(32, 96, 32, 32));

            Keys[] keys = Keyboard.GetState().GetPressedKeys();
            foreach (Keys key in keys)
            {
                Console.WriteLine(key.ToString());
            }
        }
    }
}
